﻿@model IEnumerable<OdeToFood.Models.Restaurant>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

@using (Html.BeginForm()) 
{
    @Html.DropDownList("Ciudad", new SelectList(ViewBag.Ciudades));  
    <input type ="submit" value ="Filter" />
}

@using (Html.BeginForm()) 
{
    @Html.DropDownList("Calle", new SelectList(ViewBag.Calles));  
    <input type ="submit" value ="Filter" />
}



<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Street
        </th>
        <th>
            City
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Name,"Details","Restaurant", new {id = item.ID}, null)
            @* @Html.DisplayFor(modelItem => item.Name) *@
        </td>
        <td>
             @Html.DisplayFor(modelItem => item.Address.street)                
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Address.city)                            
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>


@* @Html.ActionLink("Mostrar Restaurants en Urquiza 789", "Index", "Restaurant", new { calle = "Urquiza 789" }, null) *@

